package edu.pku.sei.transformation.editor.controller.commands.link;

import edu.pku.sei.transformation.editor.model.Rule;
import edu.pku.sei.transformation.editor.model.RuleOverride;

public class OverrideDeleteCommand extends
		AbstractLinkDeleteCommand<RuleOverride, Rule, Rule> {

	public OverrideDeleteCommand(RuleOverride link, Rule source, Rule target) {
		super(link, source, target);
	}

	@Override
	public void undo() {
		source.setOverride(link);
		link.setOverrideRule(target);
		link.setOverriedBy(source);
	}

	@Override
	public void execute() {
		source.setOverride(null);
		link.setOverrideRule(null);
		link.setOverriedBy(null);
	}
}
